<!DOCTYPE html>
<html>

<!-- Mirrored from www.zi-han.net/theme/hplus/table_jqgrid.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:20:02 GMT -->
<!-- IP黑名单页面  -->

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>IP黑名单</title>

    <link href="css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <link href="css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="css/animate.min.css" rel="stylesheet">
    <link href="css/style.min862f.css?v=4.1.0" rel="stylesheet">
    <link href="css/timePicker.css" rel="stylesheet">
    <link href="css/newStyle.css" rel="stylesheet">
    <link href="js/plugins/fancybox/jquery.fancybox.css" rel="stylesheet">

    <style>
        /* 重写bookstrap样式表 勿删 */
        .form_inputs {
            width: 160px;
            background-color: #ebebeb;
            border: 1px solid #06a3f9;
            border-radius: 20px;
            -webkit-border-radius: 20px;
            -moz-border-radius: 20px;
            -o-border-radius: 20px;
            -ms-border-radius: 20px;
        }

        .ibox-title {
            padding: 20px;
        }

        .mb30 {
            margin-bottom: 20px;
        }

        /* 重写bookstrap样式表 勿删 */
        .ui-jqdialog {
            height: auto !important;
        }

        .ui-common-table tbody {
            background-color: #eaf5fc !important;
        }

        .modal-dialog {
            margin: 80px auto !important;
        }

        .form-group {
            margin-left: 0px !important;
            margin-right: 0px !important;
        }

        .modal-sm {
            width: 600px;
        }

        .col-sm-3 {
            width: 30%;
        }

        .col-sm-8 {
            width: 70%;
        }

        .form-horizontal .control-label {
            text-align: left;
            padding-top: 5px;
            font-size: 18px;
        }

        @media only screen and (min-width: 100px) and (max-width: 600px) {
            .modal-sm {
                width: 400px;
            }

            .col-sm-3 {
                width: 40%;
            }

            .col-sm-8 {
                width: 60%;
            }

            .scroll_div {
                width: 85%;
            }

            .form-horizontal .control-label {
                text-align: left;
                padding-top: 5px;
                font-size: 14px;
            }

            .dialog_btn {
                font-size: 14px !important;
            }
        }

        @media only screen and (min-width: 650px) {
            .modal-sm {
                width: 600px;
            }
        }

        /*以下是等待状态的通用样式*/
        .wating_big_div {
            position: fixed;
            top: 0px;
            width: 100%;
            height: 100%;
            display: table;
            z-index: 9999;
        }

        .zhezhao {
            opacity: 0.3;
            position: absolute;
            top: 0px;
            width: 100%;
            height: 100%;
            z-index: 9999;
        }

        .wating_content_div {
            text-align: center;
            background: none;
            display: table-cell;
            vertical-align: middle;
        }

        /*以上是等待状态的通用样式*/
        .inputcherckStyle {
            width: 18px;
            height: 18px;
            -webkit-appearance: none;
            -moz-appearance: none;
            appearance: none;
            background: url("")
        }

        .inputcherckStyle:hover {
            background: url("")
        }

        .inputcherckStyle:checked {
            background: url("")
        }

        #timebox {
            width: 50%;
            height: 100%;
            /* display: flex;
        align-items: center; */
        }

        #timebox>span {
            width: 4.16%;
            display: block;
            float: left;
        }

        .title_choose {
            padding: 5px 10px;
            font-size: 14px;
            margin-right: 10px;
            margin-top: 8px;
            margin-bottom: 5px;
            border: 1px solid #ccc;
            text-align: center;
            cursor: pointer;
        }

        .nonetext {
            width: 100%;
            height: 40px;
            line-height: 40px;
            text-align: center;
            display: none;
        }

        /* 物流 */
        .logistics_content {
            text-align: center;
            min-height: 200px;
        }

        .logistics_li {
            position: relative;
            padding: 0px 0 20px 25px;
            line-height: 18px;
            border-left: 1px solid #A6ABAF;
            color: #999;
        }

        .logistics_li .logistics_icona {
            display: block;
            position: absolute;
            left: -7px;
            top: 0;
            width: 15px;
            height: 15px;
            z-index: 9;
        }

        .logistics_li .logistics_iconb {
            display: block;
            position: absolute;
            left: -5px;
            top: 0;
            width: 10px;
            height: 10px;
            z-index: 9;
        }

        .logistics_text {
            color: #999999;
            font-size: 12px;
            text-align: left;
            margin-bottom: 10px;
        }

        .logistics_time {
            color: #CCCCCC;
            font-size: 12px;
            text-align: left;
        }

        .input_height {
            height: 34px;
            border: 1px solid #ccc;
        }

        .form-horizontal .control-label {
            font-size: 16px !important;
        }
        .input_if {
            margin-left: 10px;
        }
    </style>
</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content  animated fadeInRight">
        <div class="row">
            <div class="col-sm-12">
                <div class="ibox ">

                    <div class="ibox-title pull-left w100p" style="padding: 10px 20px;">
                        <div class="pull-left">
                            <div class="ibox-tools cache5">
                                IP黑名单
                            </div>
                        </div>

                        <div class="pull-right">
                            <button class="refresh_btn">
                                <a class="refresh_a">
                                    <i class="fa fa-refresh"></i> 刷新
                                </a>
                            </button>
                        </div>
                    </div>

                    <div class="ibox-content pull-left w100p jqGrid_wrapper" id="uploadedWrap" data-gridtype="0"
                        style="padding-top: 0px;">
                        <div class="w100p chaxunBorder">
                            <div class="ibox-title w100p"
                                style="height:50px;background-color: rgb(243, 243, 243);padding: 10px 20px;border-top:0px;">
                                <div class="ibox-tools pull-left">
                                    <span class="titleFindIcon pull-left"></span>
                                    <span class="pull-left" style="position: relative;top: 3px;left: 5px;">筛选条件</span>
                                </div>
                                <!-- 查询按钮 -->
                                <div class="pull-right ml30">
                                    <button class="opera_btn" id="check_btn">查询</button>
                                </div>
                            </div>
                            <!-- 搜索条件 -->
                            <div class="w100p p20" style="display: flex;">
                                <!-- 新增按钮 -->
                                <div class="pull-right ml30">
                                    <button class="opera_btn" data-toggle="modal" data-target="#add_dialog">新增</button>
                                </div>

                                <!-- ip地址查询 -->
                                <div class="ml30">
                                    <span class="f14 pull-left h30 lh30">IP地址：</span>
                                    <div class="pull-left input_if">
                                        <input type="text" class="form-control h30 w100p backList" style="width: 150px;"
                                            id="check_arg2_input" placeholder="" aria-required="true">
                                    </div>
                                </div>


                            </div>
                        </div>

                        <div class="ibox-title pull-left w100p table-head"
                            style="background-color: rgb(243, 243, 243);padding: 10px 20px;border-top:0px;">
                            <div class="pull-left">
                                <div class="ibox-tools" style="">
                                    <span class="titleFontIcon"></span>
                                    <span class="pull-left" style="position: relative;top: 3px;left: 5px;">数据列表</span>
                                </div>
                            </div>
                        </div>
                        <!-- 列表标题 -->
                        <div class="pull-left w100p">
                            <table class="table table-bordered mb0 ">
                                <thead>
                                    <tr>
                                        <!-- <th><input name="Fruit" class="w20 h20 header_checkbox" type="checkbox"
                                                value="" /></th> -->
                                        <th>IP地址</th>
                                        <th>原因</th>
                                        <th>禁止</th>
                                        <th>收录时间</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody id="tbody_list1"></tbody>
                            </table>
                            <div class="nonetext">暂无数据</div>
                        </div>
                        <div class="pull-left tac c0 f14 w100p pre mt10" id="footer_page_div">
                            <div class="">
                                <div class="pull-left">
                                    <div class="ibox-tools">
                                        <a class="refresh_a">
                                            <i class="fa fa-refresh"></i> 刷新
                                        </a>
                                    </div>
                                </div>
                                <!-- 操作分页 -->
                                <span class="under_line cursor_pointer f_last_span">上一页</span>
                                <span class="pl20 f_page_span">1</span>
                                <span class="pl20 under_line cursor_pointer f_next_span">下一页</span>
                                <span class="pl20">共 <span class="f_count_page_span">1</span> 页</span>
                                <div class="disib ml20">
                                    每页显示：
                                    <select class="p0 disib f_page_select">
                                        <option value="" selected="selected">10</option>
                                        <option value="">20</option>
                                        <option value="">30</option>
                                    </select>
                                    条
                                </div>
                            </div>
                            <div class="record_right_div">

                                数据库总数量： <span class="f_counts_span">0</span> 条
                            </div>
                        </div>
                    </div>

                </div>
            </div>
        </div>
    </div>

    <!--加载遮罩组件-->
    <!-- <div class="none" id="wating_show">
        <div class="ibox wating_big_div">
            <div class="zhezhao bg_f"></div>
            <div class="ibox-content wating_content_div ">
                <div class="spiner-example">
                    <div class="sk-spinner sk-spinner-wave">
                        <div class="sk-rect1"></div>
                        <div class="sk-rect2"></div>
                        <div class="sk-rect3"></div>
                        <div class="sk-rect4"></div>
                        <div class="sk-rect5"></div>
                    </div>
                    <h5 class="f20 c0"><span id="loading_text">正在请求 ，请稍后...... </span>(<span id="second_span">0</span>)秒
                    </h5>
                </div>
            </div>
        </div>
    </div> -->


    <!--黑名单点击新增的弹窗-->
    <div class="modal inmodal fade" id="add_dialog" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog modal-sm">
            <div class="modal-content br8">
                <div class="modal-header p10 bdno">
                    <button type="button" class="close" data-dismiss="modal"><span
                            aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                    <span class="modal-title f18">新增</span>
                </div>
                <div class="modal-body bg_f p0">
                    <div class="ibox-content p30">
                        <form class="form-horizontal m-t" id="add_form" method="post">
                            <!-- <input type="hidden" class="edit_id" name="id" value="1" />
                            <input type="hidden" class="edit_type" name="type" value="1" /> -->
                            <div class="form-group ">
                                <label class="col-sm-3 control-label pull-left">IP地址</label>
                                <div class="col-sm-8 pull-left">
                                    <!-- IP地址 -->
                                    <input type="text" class="form-control edit_cateName ip_address" name="cateName"
                                        value="" required="" aria-required="true" placeholder="必填">
                                </div>
                            </div>
                            <div class="form-group ">
                                <label class="col-sm-3 control-label pull-left">原因</label>
                                <div class="col-sm-8 pull-left">
                                    <!-- 原因 -->
                                    <textarea type="text" class="form-control edit_sort reason" name="sort" value=""
                                        required="" aria-required="true" style="height: 100px;"
                                        placeholder="必填"> </textarea>
                                </div>
                            </div>
                            <!-- 禁止操作 -->
                            <div class="form-group ">
                                <label class="col-sm-3 control-label pull-left">禁止操作</label>
                                <div class="col-sm-8 pull-left" style="display: flex;">
                                    <!-- 多选框 -->
                                    <div class="form-check form-check-inline" style="margin: 7px 10px 0 3px;">
                                        <input class="form-check-input inlineCheck1" type="checkbox"
                                            id="inlineCheckbox1" value="option1" style="margin-top: 2px;">
                                        <label class="form-check-label" for="inlineCheckbox1">发短信</label>
                                    </div>

                                    <div class="form-check form-check-inline" style="margin: 7px 0 0 10px;">
                                        <input class="form-check-input inlineCheck2" type="checkbox"
                                            id="inlineCheckbox2" value="option2" style="margin-top: 2px;">
                                        <label class="form-check-label" for="inlineCheckbox2">登录</label>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
                <div class="modal-footer bdno tac pt0040">
                    <button type="button" class=" btn-white clear_btn_style dialog_btn" data-dismiss="modal">取消</button>
                    <button type="button" class=" btn-primary clear_btn_style bdno dialog_btn ml30"
                        id="add_btn">保存</button>
                </div>
            </div>
        </div>
    </div>


    <!-- 黑名单的编辑弹窗 -->
    <div class="modal inmodal fade" id="edit_dialog" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog modal-sm">
            <div class="modal-content br8">
                <div class="modal-header p10 bdno">
                    <button type="button" class="close" data-dismiss="modal"><span
                            aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                    <span class="modal-title f18">修改</span>
                </div>
                <div class="modal-body bg_f p0">
                    <div class="ibox-content p30">
                        <form class="form-horizontal m-t" id="edit_form" method="post">
                            <!-- <input type="hidden" class="edit_id" name="id" value="1" />
                            <input type="hidden" class="edit_type" name="type" value="1" /> -->
                            <div class="form-group ">
                                <label class="col-sm-3 control-label pull-left">IP地址:</label>
                                <div class="col-sm-8 pull-left">
                                    <!-- IP地址 -->
                                    <input type="text" class="form-control edit_cateName ip_code " name="cateName"
                                        value="" required="" aria-required="true" placeholder="必填">
                                </div>
                            </div>
                            <div class="form-group ">
                                <label class="col-sm-3 control-label pull-left">原因:</label>
                                <div class="col-sm-8 pull-left">
                                    <!-- 原因 -->
                                    <textarea type="text" class="form-control edit_sort cause" name="sort" value=""
                                        required="" aria-required="true" style="height: 100px;"
                                        placeholder="必填"> </textarea>
                                </div>
                            </div>
                            <!-- 禁止操作 -->
                            <div class="form-group ">
                                <label class="col-sm-3 control-label pull-left">禁止操作:</label>
                                <div class="col-sm-8 pull-left" style="display: flex;">
                                    <!-- 多选框 -->
                                    <div class="form-check form-check-inline" style="margin: 7px 10px 0 3px;">
                                        <input class="form-check-input inlineCheckbox1" type="checkbox" value="option1"
                                            style="margin-top: 2px;">
                                        <label class="form-check-label" for="inlineCheckbox3">发短信</label>
                                    </div>

                                    <div class="form-check form-check-inline" style="margin: 7px 0 0 10px;">
                                        <input class="form-check-input inlineCheckbox2" type="checkbox" value="option2"
                                            style="margin-top: 2px;">
                                        <label class="form-check-label" for="inlineCheckbox4">登录</label>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
                <div class="modal-footer bdno tac pt0040">
                    <button type="button" class=" btn-white clear_btn_style dialog_btn" data-dismiss="modal">取消</button>
                    <button type="button" class=" btn-primary clear_btn_style bdno dialog_btn ml30"
                        id="edit_btn">保存</button>
                </div>
            </div>
        </div>
    </div>

    <script src="js/jquery-2.1.0.js" type="text/javascript" charset="utf-8"></script>
    <script src="./lib/layui/layui.js" charset="utf-8"></script>
    <script src="js/bootstrap.min.js?v=3.3.6"></script>
    <script src="js/plugins/peity/jquery.peity.min.js"></script>
    <script src="js/content.min.js?v=1.0.0"></script>
    <script src="js/plugins/layer/laydate/laydate.js"></script>
    <script src="js/plugins/sweetalert/sweetalert.min.js"></script>
    <script src="js/plugins/iCheck/icheck.min.js"></script>
    <script src="js/plugins/fancybox/jquery.fancybox.js"></script>
    <script src="js/common.js" type="text/javascript" charset="utf-8"></script>
    <script src="js/jquery-timepicker.js" type="text/javascript" charset="utf-8"></script>
    <!--ajax上传插件:jquery.form ajaxSubmit-->
    <script src="js/jquery-form.js" type="text/javascript" charset="utf-8"></script>
    <script>
        layui.use(['layedit', 'laydate'],
            function () {
                var table = layui.table,
                    layer = layui.layer,
                    layedit = layui.layedit,
                    laydate = layui.laydate;
                laydate.render({
                    elem: '#chooseTim',//搜索时间框
                    type: 'datetime'
                });
                laydate.render({
                    elem: '#chooseTim1',//搜索时间框
                    type: 'datetime'
                });
            });

        var tableTimeout, addTimeout, setPowerTime, editManageTimeout, deleteTimeOut, getPowerTime,
            limits = 10,
            page = 1,
            counts = 0,
            table_title, roleID;
        var cherk_roleId;

        var totalPages = 0;
        var maxIndex;
        var userMessage;
        var backList, back_id//查询的参数

        $(document).ready(function () {
            IsTokenSave();
            userMessage = JSON.parse(sessionStorage.getItem("user_message"));

            $(".refresh_a").click(function () { //刷新按钮
                location.reload();
            });
            InitTbodyList(page);  //初始化列表数据
            $("#check_btn").click(function () { //查询按钮
                backList = $('.backList').val();
                page = 1; //重置页数
                $(".f_page_span").html(1); //重置页数
                $("#tbody_list1").html('');
                $(".nonetext").hide();
                InitTbodyList(page); //获取列表数据
            });
            //分页部分的操作
            $(".f_page_select").change(function () { //选择一页多少条数据的select
                page = 1; //重置页数
                $(".f_page_span").html(1); //重置页数
                limits = $(".f_page_select option:selected").text(); //设置当前显示数量
                InitTbodyList(page);
            });

            $(".f_last_span").click(function () { //上一页
                if (page < 2) {
                    TipsAlert("这是最前面的数据了");
                    return false;
                }
                page--;
                $(".f_page_span").html(parseInt($(".f_page_span").html()) - 1);
                InitTbodyList(page);
            });
            $(".f_next_span").click(function () { //下一页

                if (page > maxIndex - 1) {
                    TipsAlert("这是最后面的数据了");
                    return false;
                }
                page++;
                $(".f_page_span").html(parseInt($(".f_page_span").html()) + 1);
                InitTbodyList(page);
            });


            $("#add_btn").click(function () { //添加的保存按钮
                if ($("#add_form .ip_address").eq(0).val().trim() == "") {
                    TipsAlert("IP地址不能为空");
                    return false;
                }
                if ($("#add_form .reason").eq(0).val().trim() == "") {
                    TipsAlert("原因不能为空");
                    return false;
                }
                // $(this).prop('checked')
                if ($("#add_form .inlineCheck1").prop('checked') == false && $("#add_form .inlineCheck2").prop('checked') == false) {
                    TipsAlert("禁止操作必须勾选");
                    return false;
                }
                var reason_code;
                if ($("#add_form .inlineCheck1").prop('checked') == true && $("#add_form .inlineCheck2").prop('checked') == false) {
                    reason_code = 1;
                }
                if ($("#add_form .inlineCheck1").prop('checked') == false && $("#add_form .inlineCheck2").prop('checked') == true) {
                    reason_code = 2;
                }
                if ($("#add_form .inlineCheck1").prop('checked') == true && $("#add_form .inlineCheck2").prop('checked') == true) {
                    reason_code = 3;
                }
                // console.log(userMessage);
                // console.log($("#add_form").serialize());

                addTimeout = setInterval("Timeout(addTimeout)", 1000);
                $.ajax({
                    type: "post",
                    url: urls + 'technologyService/addIP',
                    async: true,
                    timeout: 30000,
                    dataType: "json",
                    headers: {
                        'X-Access-Token': userMessage.token,
                    },
                    data: {
                        ip: $('.ip_address').val(),
                        caseIP: $('.reason').val(),
                        excuType: reason_code
                    },
                    success: function (json) {
                        CheckLogout(json);//检查是否登陆过期
                        if (json.code == 0) {
                            swal({
                                title: "添加成功",
                                text: "添加成功",
                                type: "success",
                            }, function () {
                                location.reload();
                            });
                        } else {
                            TipsAlert(json.msg);
                        }
                        InitTime(addTimeout);
                    },
                    error: function (xml, text, errorThrown) {
                        if (text == "timeout") {
                            TipsAlert("请求超时,请检查网络或着重新打开该页面.");
                        } else {
                            TipsAlert("请求数据失败,请联系后台技术人员");
                        }
                        InitTime(addTimeout);
                    }
                });
            });


            $("#edit_btn").click(function () { //修改的保存按钮
                //   console.log(123)
                if ($("#edit_form .ip_code").eq(0).val().trim() == "") {
                    TipsAlert("IP地址不能为空");
                    return false;
                }

                if ($("#edit_form .cause").eq(0).val().trim() == "") {
                    TipsAlert("原因不能为空");
                    return false;
                }
                // $(this).prop('checked')
                if ($("#edit_form .inlineCheckbox1").prop('checked') == false && $("#add_form .inlineCheckbox2").prop('checked') == false) {
                    TipsAlert("禁止操作必须勾选");
                    return false;
                }
                var reason_code1;
                if ($("#edit_form .inlineCheckbox1").prop('checked') == true && $("#edit_form .inlineCheckbox2").prop('checked') == false) {
                    reason_code1 = 1;
                }

                if ($("#edit_form .inlineCheckbox1").prop('checked') == false && $("#edit_form .inlineCheckbox2").prop('checked') == true) {
                    reason_code1 = 2;
                }

                if ($("#edit_form .inlineCheckbox1").prop('checked') == true && $("#edit_form .inlineCheckbox2").prop('checked') == true) {
                    reason_code1 = 3;
                }
                addTimeout = setInterval("Timeout(addTimeout)", 1000);
                $.ajax({
                    type: "post",
                    url: urls + 'technologyService/editIP',
                    async: true,
                    timeout: 30000,
                    dataType: "json",
                    headers: {
                        'X-Access-Token': userMessage.token,
                    },
                    data: {
                        id: back_id,
                        ip: $('.ip_code').val(),
                        caseIP: $('.cause').val(),
                        excuType: reason_code1
                    },
                    success: function (json) {
                        CheckLogout(json);//检查是否登陆过期
                        if (json.code == 0) {
                            swal({
                                title: "修改成功",
                                text: "修改成功",
                                type: "success",
                            }, function () {
                                location.reload();
                            });
                        } else {
                            TipsAlert(json.return_msg);
                        }
                        InitTime(addTimeout);
                    },
                    error: function (xml, text, errorThrown) {
                        if (text == "timeout") {
                            TipsAlert("请求超时,请检查网络或着重新打开该页面.");
                        } else {
                            TipsAlert("请求数据失败,请联系后台技术人员");
                        }
                        InitTime(addTimeout);
                    }
                });
            });
        });




        /**
         * 该方法用于初始化列表
         * @param {Number} startIndex startIndex是数据起始下标
         * */
        Showload();
        function InitTbodyList(startIndex) {
            tableTimeout = setInterval("Timeout(tableTimeout)", 1000);
            var tableHtml = "";
            $.ajax({
                type: "get",
                url: urls + 'technologyService/selectIPLog',
                async: true,
                timeout: 30000,
                dataType: "json",
                headers: {
                    'X-Access-Token': userMessage.token,
                },
                data: {
                    page: startIndex,
                    limit: limits,
                    ip: backList
                },
                success: function (res) {
                    CheckLogout(res); //检查是否登陆过期
                    if (res.code == 0) {
                        totalPages = res.data.records.total;
                        var myData = res.data.records;

                        counts = res.data.total;
                        console.log(myData);
                        if (counts == 0) { //显示或隐藏分页
                            $("#footer_page_div").hide();
                            $(".nonetext").show();
                            InitTime(tableTimeout);
                            return
                        } else {
                            $("#footer_page_div").show();
                        }
                        maxIndex = (counts / limits).toCeil(0);
                        $(".f_count_page_span").html(maxIndex); //设置当前共几页  
                        $(".f_counts_span").html(counts);

                        for (var i = 0; i < myData.length; i++) {
                            var no_code;
                            if (myData[i].operation_state == 1) {
                                no_code = '发短信'
                            } else if (myData[i].operation_state == 2) {
                                no_code = '登入'
                            } else {
                                no_code = '发短信 , 登入'
                            }
                            tableHtml += '<tr>' +
                                // + '<td data-id="'+myData[i]["id"]+'" data-cateName="'+myData[i]["extend_num"]+'" data-sort="'+myData[i]["sort"]+'">'+myData[i]["id"]+'</td>'
                                '<td data-ip=' + myData[i].ipAddress + ' data-id="' + myData[i].id + '" data-cause="' + myData[i].cause + '" data-code="' + myData[i].operation_state + '">' + myData[i]["ipAddress"] + '</td>' +
                                '<td class="c_1ABC9C">' + myData[i]["cause"] + '</td>' +
                                '<td>' + no_code + '</td>' +
                                '<td>' + myData[i]["create_time"] + '</td>' +
                                '<td>' +
                                '<span class="under_line cursor_pointer edit_span  c_1ABC9C" data-toggle="modal" data-target="#edit_dialog" style="margin-right:20px;">编辑</span>'
                                + '<span class="under_line cursor_pointer delete_span c_1ABC9C" >删除</span>'
                            '</td>' +
                                '</tr>';
                        }
                        $("#tbody_list1").html(tableHtml);
                        DealTable();
                        InitFunc();

                    } else {
                        TipsAlert(json.code);
                    }
                    InitTime(tableTimeout);
                },
                error: function (xml, text, errorThrown) {
                    if (text == "timeout") {
                        TipsAlert("请求超时,请检查网络或着重新打开该页面.");
                    } else {
                        TipsAlert("请求数据失败,请联系后台技术人员");
                    }
                    InitTime(tableTimeout);
                }
            });
        }



        /**
         * 该方法用于初始化操作列里的事件
         * */
        function InitFunc() {
            $(".edit_span").each(function () { //编辑数据回写
                $(this).click(function () {
                    var dataset = $(this).parents("td").siblings("td").eq(0)[0].dataset;
                    console.log(dataset)
                    back_id = dataset.id;
                    $('.ip_code').val(dataset.ip)
                    $('.cause').val(dataset.cause)
                    if (dataset.code == 1) {
                        $('.inlineCheckbox1').prop('checked', true);
                        $('.inlineCheckbox2').prop('checked', false);
                    } else if (dataset.code == 2) {
                        $('.inlineCheckbox2').prop('checked', true);
                        $('.inlineCheckbox1').prop('checked', false);
                    } else {
                        $('.inlineCheckbox1').prop('checked', true);
                        $('.inlineCheckbox2').prop('checked', true);
                    }
                });
            });

            $(".delete_span").each(function () { //删除按钮
                $(this).click(function () {
                    var dataset = $(this).parents("td").siblings("td").eq(0)[0].dataset;
                    // console.log(JSON.parse(sessionStorage.getItem("user_message")));
                    var userMessage = JSON.parse(sessionStorage.getItem("user_message"));
                    swal({
                        title: "请再次确认是否删除？",
                        text: "删除后将无法恢复，请谨慎操作！",
                        type: "warning",
                        showCancelButton: true,
                        confirmButtonColor: "#DD6B55",
                        confirmButtonText: "是的，确定删除",
                        cancelButtonText: "让我再考虑一下…",
                        closeOnConfirm: false,
                        closeOnCancel: true
                    }, function (yes) {
                        if (yes) {
                            Showload("正在请求删除，请稍后....");
                            deleteTimeOut = setInterval("Timeout(deleteTimeOut)", 1000);
                            $.ajax({
                                type: "post",
                                url: urls + 'technologyService/deleteIP',
                                async: true,
                                timeout: 30000,
                                dataType: "json",
                                headers: {
                                    'X-Access-Token': userMessage.token,
                                },
                                data: {
                                    id: dataset.id,
                                    ipType: 2
                                },
                                success: function (json) {
                                    // console.log(json);
                                    CheckLogout(json);
                                    if (json.code == 0) {
                                        swal({
                                            title: "删除成功",
                                            text: "删除成功",
                                            type: "success",
                                        }, function () {
                                            location.reload();
                                        });
                                    }
                                    InitTime(deleteTimeOut);
                                },
                                error: function (xml, text, e) {
                                    if (text == "timeout") {
                                        TipsAlert("请求超时,请检查网络或着重新操作");
                                    } else {
                                        TipsAlert("请求数据失败,请联系后台技术人员");
                                    }
                                    InitTime(deleteTimeOut);
                                }
                            });
                        }
                    });

                });
            }); //编辑按钮结束括号
        }
    </script>

</body>

</html>